﻿<UserControl x:Class="LiveTiss.Guias.UserControls.Endereco"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" x:Name="root"
    xmlns:converter="clr-namespace:LiveTiss.Classes.TypeConverter">
    
    <UserControl.Resources>
        <converter:EnumConverter x:Key="enumConverter"  />
    </UserControl.Resources>
    
    <StackPanel Width="890">
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <TextBlock TextWrapping="Wrap" Text="T.L.:" FontFamily="Segoe UI" FontSize="13.333"/>
                <ComboBox Name="cbxTipoLogradouro" Width="180" Margin="0,6,0,0" SelectedValue="Key" DisplayMemberPath="Value" HorizontalAlignment="Left" 
                          ItemsSource="{Binding Value.tipoLogradouroItems,ElementName=root, Mode=OneWay}"
                          SelectedIndex="{Binding Value.tipoLogradouro,Converter={StaticResource enumConverter}, ConverterParameter='TipoLogradouro', ElementName=root,Mode=TwoWay}"/>
            </StackPanel>
            <TextBlock TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
        </Grid>
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <TextBlock TextWrapping="Wrap" Text="Logadouro:" FontFamily="Segoe UI" FontSize="13.333"/>
                <TextBox Name="txtLogradouro" Margin="0,6,323,0" MaxLength="40" 
                         Text="{Binding Value.logradouro, ValidatesOnDataErrors=True,NotifyOnValidationError=True,ElementName=root,Mode=TwoWay}"/>
            </StackPanel>
            <TextBlock TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
        </Grid>
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <TextBlock TextWrapping="Wrap" Text="Número:" FontFamily="Segoe UI" FontSize="13.333"/>
                <TextBox Name="txtNumeroLogradouro" Margin="0,6,323,0" MaxLength="5" 
                         Text="{Binding Value.numero, ElementName=root,ValidatesOnDataErrors=True,NotifyOnValidationError=True,Mode=TwoWay}" />
            </StackPanel>
            <TextBlock TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
        </Grid>
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <TextBlock TextWrapping="Wrap" Text="Complemento:" FontFamily="Segoe UI" FontSize="13.333"/>
                <TextBox Name="txtComplementoLogradouro" Margin="0,6,323,0" MaxLength="15" 
                         Text="{Binding Value.complemento, ElementName=root,ValidatesOnDataErrors=True,NotifyOnValidationError=True,Mode=TwoWay}"/>
            </StackPanel>
        </Grid>
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <TextBlock TextWrapping="Wrap" Text="Município:" FontFamily="Segoe UI" FontSize="13.333"/>
                <TextBox Name="txtMunicipio" Margin="0,6,323,0" MaxLength="40" 
                         Text="{Binding Value.municipio,ElementName=root,ValidatesOnDataErrors=True,NotifyOnValidationError=True,Mode=TwoWay}" />
            </StackPanel>
        </Grid>
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <TextBlock TextWrapping="Wrap" Text="UF:" FontFamily="Segoe UI" FontSize="13.333"/>
                <ComboBox Name="cbxUFLogradouro" Width="180" Margin="0,6,0,0" SelectedValue="Key" DisplayMemberPath="Value" HorizontalAlignment="Left" 
                          ItemsSource="{Binding Value.ufItems,ElementName=root,Mode=OneWay}"
                          SelectedIndex="{Binding Value.codigoUF,Converter={StaticResource enumConverter}, ConverterParameter='UF', ElementName=root,NotifyOnValidationError=True,Mode=TwoWay}"/>
            </StackPanel>
        </Grid>
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <TextBlock TextWrapping="Wrap" Text="Código IBGE:" FontFamily="Segoe UI" FontSize="13.333"/>
                <TextBox Name="txtCodigoIBGE" Margin="0,6,323,0" MaxLength="7" 
                         Text="{Binding Value.codigoIBGEMunicipio, ElementName=root,ValidatesOnDataErrors=True,NotifyOnValidationError=True,Mode=TwoWay}" />
            </StackPanel>
            <TextBlock TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
        </Grid>
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <TextBlock TextWrapping="Wrap" Text="CEP:" FontFamily="Segoe UI" FontSize="13.333"/>
                <TextBox Name="txtCEP" Margin="0,6,323,0" MaxLength="8" 
                         Text="{Binding Value.cep, ElementName=root,ValidatesOnDataErrors=True,NotifyOnValidationError=True,Mode=TwoWay}" />
            </StackPanel>
            <TextBlock TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
        </Grid>
    </StackPanel>
</UserControl>
